﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace Evaluant.PS4VS.Renderer
{
    static class ColorConverter
    {
        public static ConsoleColor ToConsoleColor(this Color color)
        {
            if (color == Color.Black)
                return ConsoleColor.Black;
            if (color == Color.Blue)
                return ConsoleColor.Blue;
            if (color == Color.Cyan)
                return ConsoleColor.Cyan;
            if (color == Color.DarkBlue)
                return ConsoleColor.DarkBlue;
            if (color == Color.DarkCyan)
                return ConsoleColor.DarkCyan;
            if (color == Color.DarkGray)
                return ConsoleColor.DarkGray;
            if (color == Color.DarkGreen)
                return ConsoleColor.DarkGreen;
            if (color == Color.DarkMagenta)
                return ConsoleColor.DarkMagenta;
            if (color == Color.DarkRed)
                return ConsoleColor.DarkRed;
            if (color == Color.Orange)
                return ConsoleColor.DarkYellow;
            if (color == Color.Gray)
                return ConsoleColor.Gray;
            if (color == Color.Green)
                return ConsoleColor.Green;
            if (color == Color.Magenta)
                return ConsoleColor.Magenta;
            if (color == Color.Red)
                return ConsoleColor.Red;
            if (color == Color.White)
                return ConsoleColor.White;
            if (color == Color.Yellow)
                return ConsoleColor.Yellow;
            return ConsoleColor.Black;
        }

        public static Color ToDrawingColor(this ConsoleColor color)
        {
            switch (color)
            {
                case ConsoleColor.Black:
                    return Color.Black;
                case ConsoleColor.Blue:
                    return Color.Blue;
                case ConsoleColor.Cyan:
                    return Color.Cyan;
                case ConsoleColor.DarkBlue:
                    return Color.DarkBlue;
                case ConsoleColor.DarkCyan:
                    return Color.DarkCyan;
                case ConsoleColor.DarkGray:
                    return Color.DarkGray;
                case ConsoleColor.DarkGreen:
                    return Color.DarkGreen;
                case ConsoleColor.DarkMagenta:
                    return Color.DarkMagenta;
                case ConsoleColor.DarkRed:
                    return Color.DarkRed;
                case ConsoleColor.DarkYellow:
                    return Color.Orange;
                case ConsoleColor.Gray:
                    return Color.Gray;
                case ConsoleColor.Green:
                    return Color.Green;
                case ConsoleColor.Magenta:
                    return Color.Magenta;
                case ConsoleColor.Red:
                    return Color.Red;
                case ConsoleColor.White:
                    return Color.White;
                case ConsoleColor.Yellow:
                    return Color.Yellow;
                default:
                    return Color.Black;
            }
        }
    }
}
